#ifndef EXPRESSIONNODE_HPP
# define EXPRESSIONNODE_HPP

# include <map>

# include "Tribool.hpp"

class Universe;

namespace NodeType
{
    enum Type
    {
        Value,
        Operator,
        OutAnd,
        OutOr
    };
}

class ExpressionNode
{
public:
    ExpressionNode();
    virtual ~ExpressionNode();

    int getId() const;
    void setId(int id);
    void setValue(Tribool value);

public:
    virtual NodeType::Type getType() const = 0;
    virtual Tribool solve(Universe& universe) = 0;
    virtual void addChild(ExpressionNode* child) = 0;
    virtual ExpressionNode* clone(std::map<int, ExpressionNode*>& existingNodes) = 0;

protected:
    int _id;
    bool _solved;
    Tribool _value;

private:
    static int _autoIncrement;
};

#endif // EXPRESSIONNODE_HPP
